package com.anlgin.anl_tea.mapper;

import com.anlgin.anl_tea.entities.Commodity;
import com.anlgin.anl_tea.entities.Order;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface OrderMapper {
    //添加订单
    public void insertOrder(Order order);
    //将订单下的商品加入到订单商品表
    public void insertOrderCommodity(Commodity commodity);
    //根据用户和订单状态来查询订单
    public List<Order> getOrderByState(Order order);
    //根据订单id获取该订单下的商品
    public List<Commodity> getCommodityByOrder(Order order);
    //根据用户获取历史订单
    public List<Order> getHistoryOrder(Order order);
    //获取正在进行的订单
    public List<Order> getCurrentOrder();
    //获取已取消订单
    public List<Order> getCancelOrder();
    //获取已完结订单
    public List<Order> getFinishOrder();
    //获取等待支付订单
    public List<Order> getWaitPayOrder();
    //改边订单状态
    public void changeOrderToComplate(Order order);
}
